#!/bin/bash
. makeconfig.sh
exec > makefile
echo "all: $BIN_FILE"
objectlist=""
for class in $CLASSES
do
headerfile="$class.h"
objectfile=`echo $headerfile | sed "s/\.h/\.o/g"`
sourcefile=`echo $headerfile | sed "s/\.h/\.cpp/g"`
if echo $COMMON_CLASSES | grep $class > /dev/null; then
	headerfile="../common/$headerfile"
	sourcefile="../common/$sourcefile"
fi
echo "$objectfile: $headerfile $sourcefile"
echo "	g++ -c -o $objectfile $INCLUDES $sourcefile"
objectlist="$objectlist $objectfile"
done
echo "$BIN_FILE: $objectlist"
echo "	g++ $PAL_OPTS $QT_OPTS $INCLUDES -o $BIN_FILE $objectlist $MAIN_FILE"
echo "clean:"
echo "	rm -f $objectlist"
echo "re: clean all"
echo ".PHONY: all clean"
